BUG_ON() is a macro very very similar to assert(), and it's a really bad
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 27 Oct 2005 16:09:01 +0000 (17:09 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 27 Oct 2005 16:09:01 +0000 (17:09 +0100)
commit650fa32a005d49cdec715a3cdd4d1955d57036a8
treec5dd70d8a097be34f27dcc9379b11529859c27a6
parentf76bd5cf5e9e56b46c8c5acb595dbec6b842c34d
BUG_ON() is a macro very very similar to assert(), and it's a really bad
idea in general to put statements with side-effects inside such a construct
(for example the BUG_ON() could be compiled away for non-debug builds).

The patch below fixes this for the drivers/xen tree.

I chose the general construct to store the respective return values in a
local var instead of an if (...) BUG(); because it looks like most of these
BUG_ON()'s need to be replaced by real error handling when going towards
production releases anyway, and then the local variable is going to be
needed anyway. (and besides the if construct tends to get unreable due to
the unlikely() etc).

Please apply.

Greetings,
   Arjan van de Ven
12 files changed:
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
linux-2.6-xen-sparse/drivers/xen/blkback/interface.c
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c
linux-2.6-xen-sparse/drivers/xen/blktap/interface.c
linux-2.6-xen-sparse/drivers/xen/evtchn/evtchn.c
linux-2.6-xen-sparse/drivers/xen/netback/interface.c
linux-2.6-xen-sparse/drivers/xen/netback/netback.c
linux-2.6-xen-sparse/drivers/xen/tpmback/interface.c
linux-2.6-xen-sparse/drivers/xen/util.c
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c